<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            height: 30px;
        }
        #box{
            height: 100%;
            width: 200px;
            border:1px solid #000;
            line-height: 30px;
            text-align: center;
            float: left;
        }
        button{
            height: 100%;
            color: #fff;
            background:#c92007;
            border: 1px solid #c92007;
            float: left;
        }
    </style>
</head>
<body>
<div>
    <div id="box">时分秒毫秒</div>
    <button id="but">开始</button>
</div>

    <script>

        oBtn=document.querySelector("#but");
        oBox=document.querySelector("#box");
        var num=0;

        oBtn.onclick=function(){
            setInterval(function(){
                var h=parseInt((num/60/60)%24)+"";
                var m=parseInt((num/60)%60)+"";
                var s=parseInt(num%60)+"";
                var str=`${h.padStart(2,"0")}时${m.padStart(2,"0")}分${s.padStart(2,"0")}秒`;
                oBox.innerHTML=str.fontcolor("red");
                num++;
            }, 1000);
        }
    </script>
</body>
</html>